Optimal. Leaf size=61 \[ \frac {(2 a B+b C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {(b B+a C) \tan (c+d x)}{d}+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {4133, 3855,
3852, 8} \begin {gather*} \frac {(a C+b B) \tan (c+d x)}{d}+\frac {(2 a B+b C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b C \tan (c+d x) \sec (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 4133
Rubi steps
\begin {align*} \int (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {b C \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \int \left ((2 a B+b C) \sec (c+d x)+2 (b B+a C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b C \sec (c+d x) \tan (c+d x)}{2 d}+(b B+a C) \int \sec ^2(c+d x) \, dx+\frac {1}{2} (2 a B+b C) \int \sec (c+d x) \, dx\\ &=\frac {(2 a B+b C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d}-\frac {(b B+a C) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=\frac {(2 a B+b C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {(b B+a C) \tan (c+d x)}{d}+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 75, normalized size = 1.23 \begin {gather*} \frac {a B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b C \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b B \tan (c+d x)}{d}+\frac {a C \tan (c+d x)}{d}+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 75, normalized size = 1.23
method | result | size |
derivativedivides | \(\frac {b B \tan \left (d x +c \right )+C b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+B a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a C \tan \left (d x +c \right )}{d}\) | \(75\) |
default | \(\frac {b B \tan \left (d x +c \right )+C b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+B a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a C \tan \left (d x +c \right )}{d}\) | \(75\) |
norman | \(\frac {\frac {\left (2 b B +2 a C +C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (2 b B +2 a C -C b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {\left (2 B a +C b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {\left (2 B a +C b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(123\) |
risch | \(-\frac {i \left (C b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 B b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 C a \,{\mathrm e}^{2 i \left (d x +c \right )}-C b \,{\mathrm e}^{i \left (d x +c \right )}-2 b B -2 a C \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a}{d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a}{d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{2 d}\) | \(160\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 88, normalized size = 1.44 \begin {gather*} -\frac {C b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 4 \, B a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) - 4 \, C a \tan \left (d x + c\right ) - 4 \, B b \tan \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.45, size = 96, normalized size = 1.57 \begin {gather*} \frac {{\left (2 \, B a + C b\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, B a + C b\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (C b + 2 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (B + C \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 153 vs.
\(2 (57) = 114\).
time = 0.48, size = 153, normalized size = 2.51 \begin {gather*} \frac {{\left (2 \, B a + C b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, B a + C b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (2 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.77, size = 104, normalized size = 1.70 \begin {gather*} \frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,B\,b+2\,C\,a+C\,b\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,B\,b+2\,C\,a-C\,b\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (2\,B\,a+C\,b\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________